package com.lib093.rich.utils

import android.content.Context
import android.view.View

class PopupParams(var mContext: Context) {
        var layoutResId = 0 //布局id = 0
        var mWidth = 0
        var mHeight = 0 //弹窗的宽和高 = 0
        var isShowAnim = false
        var animationStyle=0 //动画Id = 0
        var mView: View? = null
        var isTouchable = true
        fun apply(controller: PopupController) {
            if (mView != null) {
                controller.setView(mView)
            } else if (layoutResId != 0) {
                controller.setView(layoutResId)
            } else {
                throw IllegalArgumentException("PopupView's contentView is null")
            }
            controller.setWidthAndHeight(mWidth, mHeight)
            controller.setOutsideTouchable(isTouchable) //设置outside可点击
            if (isShowAnim) {
                controller.setAnimationStyle(animationStyle)
            }
        }

    }